/*
 * @Author: zxh
 * @Date: 2024-07-29 11:38:21
 * @LastEditors: zxh
 * @LastEditTime: 2024-07-29 11:48:49
 * @Description: 封装banner轮播图相关的业务代码
 */
import { ref, onMounted } from 'vue'
import { getBannerAPI } from '@/apis/home'
export function useBanner(type: string) {
  const bannerList = ref<any[]>([])
  const getBanner = async () => {
    const res = await getBannerAPI({
      distributionSite: type
    })
    bannerList.value = res.result
  }

  onMounted(() => {
    getBanner()
  })
  return {
    bannerList
  }
}
